package cn.lovemmd.bms.mapper;

import cn.lovemmd.bms.pojo.Admin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

@Mapper
public interface AdminMapper extends BaseMapper<Admin> {
    @Select("select * from bms_user where user_name=#{userName} and user_password=#{userPassword}")
    Admin login(String userName, String userPassword);
    @Insert("insert into bms_user(user_name,user_password,user_authority) values(#{userName},#{userPassword},#{userAuthority})")
    Integer register(String userName, String userPassword, String userAuthority);
    @Delete("delete from bms_user where user_id=#{userId}")
    Integer signOut(int userId);
    @Update("update bms_user set user_password=#{userPassword} where user_id=#{userId}")
    Integer updatePassword(int userId, String userPassword);
}
